package com.polaris.live.utils

import android.content.Context
import com.polaris.live.constant.UserConst
import com.polaris.live.im.sfs.bean.live.ext.UserBasicVo
import com.polaris.live.utils.route.RoutePath
import com.polaris.live.utils.route.Router

/**
 * 消息跳转代理
 *
 * @author Created by lucas on 2024/2/18 06:32
 */
object StartMessageProxy {

    /**
     * 跳转到消息页
     */
    fun gotoMessage(content: Context, @UserConst.FromType page: Int, userBasic: UserBasicVo) {
        Router.builder(RoutePath.MESSAGE_ACTIVITY)
            .withInt("page", page)
            .withString("nickname", userBasic.nickname)
            .withString("avatar", userBasic.avatar)
            .apply {
                userBasic.avatarFrame?.also { af -> withString("avatarFrame", af) }
                userBasic.chatBubble?.also { cb -> withString("chatBubble", cb) }
            }
            .withLong("userId", userBasic.userId)
            .navigation(content)
    }
}